SpatialStream® Code Examples

Query Using Polygon Constraints

Using one or more polygon constraints is a powerful way to query and return data that meet specific location criteria. The SpatialStream® GetQuery functional component offers the ability to limit spatial query results based on polygonal constraints. This example uses a single inclusion polygon in blue and a single exclusion polygon in red. The first query (Inclusion) will return all of the gas stations that fall within the inclusion geometry. The second query (Exclusion) will add the exclusion geometry to the query and will return gas stations that are within the inclusion polygon but not those that are within the exclusion polygon.

The primary benefit of this service is that by passing in multiple inclusion and exclusion constraints, you can perform complex spatial queries with ease and obtain far more granular query results, all in a single call, and with minimal application code.

GetQuery

var url = "GetQuery.aspx?dataSource=ACCOUNT_FOLDER/IrvineGasStations";
url += "&inclusionGeometries=" + inclusion;
url += "&exclusionGeometries=" + exclusion;
url += "&returnGeoType=1";
url += "&cache=true";


Run Sample   View Video   Back To Index